﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EthernetTools.Utils;

namespace EthernetTools.Protocols.PPPoE
{
    public class PPPoEConnectionInfo
    {
        #region Constant And Fields
        #endregion 
        
        #region Properties

        /// <summary>
        /// Mac adress of Access commutator to which Host is connected
        /// </summary>
        public byte[] AcMac
        {
            get;
            private set;
        }

        /// <summary>
        /// Mac address of host which is connected to ac
        /// </summary>
        public byte[] HostMac
        {
            get;
            private set;
        }

        /// <summary>
        /// PPPoE session id
        /// </summary>
        public byte[] SessionId
        {
            get;
            private set;
        }

        /// <summary>
        /// Time stamp of detection
        /// </summary>
        public long TimeStamp
        {
            get;
            private set;
        }

        #endregion
        
        #region Constructors And Destructors

        public PPPoEConnectionInfo(byte[] acMac, byte[] hostMAc, byte[] sessionID, long timeStamp)
        {
            this.AcMac = acMac;
            this.HostMac = hostMAc;
            this.SessionId = sessionID;
            this.TimeStamp = timeStamp;
        }

        #endregion
        
        #region Public Methods

        public override string ToString()
        {
            return ByteUtils.ByteArrToString(this.HostMac)
                + " conneted to:"
                + ByteUtils.ByteArrToString(this.AcMac)
                + "; sid = " + ByteUtils.ByteArrToString(this.SessionId);
        }

        #endregion
        
        #region Methods
        #endregion
    }
}
